# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
from django.utils.six import python_2_unicode_compatible

# Create your models here.
'''员工工号可上网类型：公司内网；PC端外网；移动端外网'''
@python_2_unicode_compatible
class Worker_net_type(models.Model):
    net_type_name = models.CharField(max_length=32, verbose_name='账号上网类型')

    def __str__(self):
        return self.net_type_name

    class Meta:
        db_table = 'pep_worker_net_type'  # 数据库名
        verbose_name = '员工可上网类型'  # 修改从管理级'产品中心'进入后的页面显示，显示为'产品'
        verbose_name_plural = '员工可上网类型'  # 修改管理级页面显示

'''员工职务信息'''
@python_2_unicode_compatible
class Title_type(models.Model):
    title_name = models.CharField(max_length=32, verbose_name='职务名称')

    def __str__(self):
        return self.title_name

    class Meta:
        db_table = 'pep_title_type'  # 数据库名
        verbose_name = '员工职称'  # 修改从管理级'产品中心'进入后的页面显示，显示为'产品'
        verbose_name_plural = '员工职务信息'  # 修改管理级页面显示

'''员工预算级别'''
@python_2_unicode_compatible
class Class_type(models.Model):
    class_name = models.CharField(max_length=32, verbose_name='预算级别')

    def __str__(self):
        return self.class_name

    class Meta:
        db_table = 'pep_class_type'  # 数据库名
        verbose_name = '员工级别'  # 修改从管理级'产品中心'进入后的页面显示，显示为'产品'
        verbose_name_plural = '员工预算级别'  # 修改管理级页面显示


'''员工归属地信息'''
@python_2_unicode_compatible
class Address_info(models.Model):
    address_name = models.CharField(max_length=32, verbose_name='员工归属地')

    def __str__(self):
        return self.address_name

    class Meta:
        db_table = 'pep_address_info'  # 数据库名
        verbose_name = '归属地'  # 修改从管理级'产品中心'进入后的页面显示，显示为'产品'
        verbose_name_plural = '员工归属地信息'  # 修改管理级页面显示

'''员工状态信息（当前及离职）'''
@python_2_unicode_compatible
class Stuff_state_info(models.Model):
    state_name = models.CharField(max_length=32, verbose_name='员工状态信息')

    def __str__(self):
        return self.state_name

    class Meta:
        db_table = 'pep_stuff_state_info'  # 数据库名
        verbose_name = '员工状态'  # 修改从管理级'产品中心'进入后的页面显示，显示为'产品'
        verbose_name_plural = '员工状态信息'  # 修改管理级页面显示

'''员工人员属性信息'''
@python_2_unicode_compatible
class Stuff_property_info(models.Model):
    property_name = models.CharField(max_length=32, verbose_name='人员属性信息')

    def __str__(self):
        return self.property_name

    class Meta:
        db_table = 'pep_stuff_property_info'  # 数据库名
        verbose_name = '人员属性'  # 修改从管理级'产品中心'进入后的页面显示，显示为'产品'
        verbose_name_plural = '人员属性信息'  # 修改管理级页面显示

'''员工的工作相关信息（主要记录工号及分配的IP地址）'''
@python_2_unicode_compatible
class Worker_info(models.Model):
    worker_name = models.CharField(max_length=64, verbose_name='员工姓名')
    worker_number = models.CharField(max_length=6, verbose_name='员工工号')
    worker_re_number = models.CharField(max_length=6, verbose_name='报销系统编码')
    worker_title_number = models.ForeignKey(Title_type, verbose_name='职务')
    worker_class_number = models.ForeignKey(Class_type, verbose_name='级别')
    worker_address_number = models.ForeignKey(Address_info, verbose_name='归属地')
    worker_property_number = models.ForeignKey(Stuff_property_info, verbose_name='人员属性')
    worker_telnumber = models.CharField(max_length=11, verbose_name='联系电话')
    worker_email = models.CharField(max_length=64, verbose_name='工作邮箱')
    worker_net_type = models.ForeignKey(Worker_net_type, verbose_name='工号上网类型')
    worker_ip = models.CharField(max_length=128, verbose_name='分配IP')
    worker_apply_date = models.DateField(verbose_name='IP分配日期')
    worker_state = models.ForeignKey(Stuff_state_info, verbose_name='员工状态')
    worker_remark = models.TextField(blank=True, verbose_name='备注')



    def __str__(self):
        return self.worker_name

    class Meta:
        db_table = 'pep_worker_info'  # 数据库名
        verbose_name = '员工'  # 修改从管理级'产品中心'进入后的页面显示，显示为'产品'
        verbose_name_plural = '员工信息'  # 修改管理级页面显示


